<%-- 
    Document   : main
    Created on : Feb 14, 2012, 9:33:28 AM
    Author     : administrator2
--%>

<%-- Header Area --%>
<%@ include file="/template/header.jsp" %> 
<%-- End of Header Area --%>


<%-- Content Area --%>
<h2>${title}</h2>
<div class="submenu">
    <ul>
        <li><a href="/manage">Manage</a></li>
        <li><a href="/manage/product/add">+ New Product</a></li>
    </ul>
    <div class="clear"></div>
</div>

<table class="generic-vertical-table">
    <tr>
        <th>ID</th>
        <th>Name</th>
        <th>Active</th>
        <th>Actions</th>
    </tr>
    <% if (products != null) { %>

    <% for (Product p : products) {%>
    <tr>
        <td><%= p.getId()%></td>
        <td><%= p.getName()%></td>
        <td><%= p.isActive() ? "Active" : "Inactive"%></td>

        <td>

            <a href="/manage/product/modify?id=<%= p.getId()%>">Modify</a> | 
            <% if (p.isActive()) {%>
            <a href="/manage/product/activate?id=<%= p.getId()%>&action=deactivate">Deactivate</a>
            <% } else {%>
            <a href="/manage/product/activate?id=<%= p.getId()%>&action=activate">Activate</a>
            <% } %>
        </td>
    </tr>
    <% }%>
    <% } else {%>
    <tr>
        <td colspan="4" align="center">
            No products yet.
        </td>
    </tr>
    <% }%>
</table>

<%-- Footer Area --%>
<%@ include file="/template/footer.jsp" %>
<%-- End of Footer Area --%>